package myJs.admin.editSample

import com.softwaremill.quicklens._
import myJs.Implicits._
import myJs.admin.sampleManage.SampleManage
import myJs.myPkg.jquery.{$, JQuery}
import myJs.myPkg.{LayerOptions, ReactRouterDOM, SwalOptions, layer, swal}
import myJs.tool.Tool
import myJs.CpLayer
import myJs.api.Api
import myJs.common._
import myJs.cps.{ImageSelectCp, PureDatePickerCp, Style}
import myJs.myPkg.reactHookForm.{ReactHookForm, UseFormOptions}
import org.scalajs.dom.{File, FormData, URLSearchParams, XMLHttpRequest, html}
import org.scalajs.macrotaskexecutor.MacrotaskExecutor.Implicits._
import shared.pojo.Sample._
import slinky.core.FunctionalComponent
import slinky.core.annotations.react
import slinky.core.facade.Hooks.{useEffect, useState}
import slinky.core.facade.React
import slinky.web.html._
import upickle.default._

import scala.collection.immutable.SeqMap
import scala.scalajs.js
import scala.scalajs.js.JSON

/**
 * Created by yz on 21/1/2022
 */
@react object Cp {

  val curPage = EditSample
  type Props = Unit

  val component = FunctionalComponent[Props] { props =>

    object FTool {

    }

    CpLayer(title = curPage.titleStr)(
      div(className := "page-content",
        div(className := "row-fluid",
          div(className := "row",
            div(className := "col-md-12 col-sm-12",
              div(className := "portlet light",
                div(className := "portlet-title",
                  div(className := "item",
                    div(className := "title clear",
                      a(href := s"#${SampleManage.absolutePath}", SampleManage.titleStr), " / ",
                      span(curPage.titleStr)
                    )
                  ),
                ),
                div(className := "portlet-body",

                  EditSampleFormCp(updated2Page = SampleManage)

                ),
              )
            )
          )
        )
      )
    )

  }


}
